#ifndef UI_ELEMENT_ICON_H__
#define UI_ELEMENT_ICON_H__
#include "ProjectHeader.h"
#include "UIElement.h"

class UIIconElement : public UIElement
{
public:
	bool Draw(std::vector<vertex> * VBOVec, const std::map<int, texCoord2f>& texMap, GLuint currentTex);
	bool DrawForeground(std::vector<vertex> * VBOVec, const std::map<int, texCoord2f>& texMap, GLuint currentTex);
	bool DrawBackground(std::vector<vertex> * VBOVec, const std::map<int, texCoord2f>& texMap, GLuint currentTex);

	void SetIconBackground(texCoord2f iconBackgroundTexture);
	void SetIconPosition(vertex2f btmLft, vertex2f topRgt);
	void SetIconTexture(std::map<int, texCoord2f> * icons);
	void SetIconMode( bool invalidAsLastIcon);

private:
	std::map<int, texCoord2f> _iconTextures;	//Maps the icons displayed to the status inputs given
	texCoord2f _iconBackgroundTexture;			//Holds the texture for the background of the icon display; visible through alpha on the icon, or if there's no icon in place

	bool _invalidAsLastIcon;	//True if invalid int outputs don't change the current icon, leaving the last valid one. Otherwise, no icon is shown and the background is visible
	
	vertex2f _iconBtmLft;	//Holds the bottom left corner of the icon, in element-relative units (0-1 goes from left or bottom of the element to top or right of the element)
	vertex2f _iconTopRgt;	//Holds the top right corner of the icon, in element-relative units (0-1 foes from left or bottom of the element to top or right of the element)	
};

#endif